<?php

namespace app\api\model;

use app\common\model\BaseModel;
use think\Model;

class LanguageQuestion extends Model
{
    public function question()
    {
        return $this->hasOne(Question::class, 'question_id', 'question_id');
    }
    /**
     * 题目
     */
    public static function getQuestion($languageId)
    {
        $questions = self::with(['question' => function ($query) {
            $query->with('questionBank');
        }])->where('language_id', $languageId)->order(BaseModel::WEIGH_DESC)->select();
        return $questions;
    }
}
